package Andrew.SpringDemo.Controller;

import Andrew.SpringDemo.Model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;

@Controller
@RequestMapping("/Document")
public class DocumentController {

    /*
     * @Autowired UserService server;
     */
    @RequestMapping(value = "/List", method = RequestMethod.GET)
    @ResponseBody
    public ArrayList<User> List(Model model) {

        ArrayList<User> list = new ArrayList<User>();
        for (int i = 0; i < 12; i++) {
            User user = new User();
            user.Id = 0;
            user.Name = "wmg";
            user.Age = 28;
            list.add(user);
        }
        return list;
    }
}
